package com.springboot.framework.service;

import com.github.pagehelper.PageInfo;
import com.springboot.framework.model.OrderModel;

import java.util.List;

/**
 * @Author SWF
 * @Date 2019/6/10 10:32
 **/
public interface OrderService {
    /**
     * 创建订单 买家
     * @return
     */
    OrderModel create(OrderModel orderModel);

    /**
     * 查询单个订单
     * @param orderId
     * @return
     */
    OrderModel get(String orderId);

    /**
     * 根据店铺查看订单
     * @return
     */
    PageInfo listByShopId(Integer shopId, Integer pageNum, Integer pageSize);

    /**
     * 根据店铺，查看未接单(代发货)和已接单(待收货)的订单
     * @param shopId
     * @return
     */
    List<OrderModel> listUnfilledAndUnreceivedByShopId(Integer shopId);

    List<OrderModel> listByShopIdAndSort(Integer shopId);

    /**
     * 根据店铺,状态查看订单
     * @param shopId 店铺id
     * @param status 状态
     * @return
     */
    List<OrderModel> listByShopIdAndStatus(Integer shopId, Byte status);

    /**
     * 根据用户查看订单
     */
    List<OrderModel> listByUserId(Integer userId);

    List<OrderModel> listByUserIdAndStatus(Integer userId, Byte status);

    /**
     * 取消订单
     */
    OrderModel cancel(OrderModel orderModel);

    /**
     * 完结订单
     * @return
     */
    OrderModel finish(OrderModel orderModel);

    /**
     * 接受订单
     * @param orderModel
     * @return
     */
    OrderModel receive(OrderModel orderModel);

    /**
     * 支付订单
     * @param orderModel
     * @return
     */
    OrderModel paid(OrderModel orderModel);

}
